package goods

type Filter struct {
	PriceMin    int32  `binding:"number" form:"pmin"`
	PriceMax    int32  `binding:"number" form:"pmax"`
	IsHot       bool   `binding:"boolean" form:"ih"`
	IsNew       bool   `binding:"boolean" form:"in"`
	IsTab       bool   `binding:"boolean" form:"it"`
	TopCategory int32  `binding:"number" form:"c"`
	Pages       int32  `binding:"number" form:"pn"`
	PagePerNums int32  `binding:"number" form:"pnum"`
	KeyWords    string `binding:"" form:"q"`
	Brand       int32  `binding:"number" form:"b"`
}

type Goods struct {
	ID int32 `uri:"id" binding:"required,number,gt=0"`
}

type Form struct {
	Name        string   `form:"name" json:"name" binding:"required,min=2,max=100"`
	GoodsSn     string   `form:"goods_sn" json:"goods_sn" binding:"required,min=2,lt=20"`
	Stocks      int32    `form:"stocks" json:"stocks" binding:"required,min=1"`
	CategoryId  int32    `form:"category_id" json:"category_id" binding:"required"`
	MarketPrice int32    `form:"market_price" json:"market_price" binding:"required,min=0"`
	ShopPrice   int32    `form:"shop_price" json:"shop_price" binding:"required,min=0"`
	GoodsBrief  string   `form:"goods_brief" json:"goods_brief" binding:"required,min=3"`
	Images      []string `form:"images" json:"images" binding:"required,min=1"`
	DescImages  []string `form:"desc_images" json:"desc_images" binding:"required,min=1"`
	ShipFree    *bool    `form:"ship_free" json:"ship_free" binding:"required"`
	FrontImage  string   `form:"front_image" json:"front_image" binding:"required,url"`
	Brand       int32    `form:"brand_id" json:"brand_id" binding:"required"`
}

type StatusForm struct {
	IsNew  *bool `form:"new" json:"new" binding:"required"`
	IsHot  *bool `form:"hot" json:"hot" binding:"required"`
	OnSale *bool `form:"sale" json:"sale" binding:"required"`
}
